import request from "@/utils/request";

// 查询用户勋章列表
export function listUsermedal(query) {
  return request({
    url: "/system/usermedal/list",
    method: "get",
    params: query,
  });
}

// 查询用户勋章详细
export function getUsermedal(id) {
  return request({
    url: "/system/usermedal/" + id,
    method: "get",
  });
}

// 新增用户勋章
export function addUsermedal(data) {
  return request({
    url: "/system/usermedal",
    method: "post",
    data: data,
  });
}

// 修改用户勋章
export function updateUsermedal(data) {
  return request({
    url: "/system/usermedal",
    method: "put",
    data: data,
  });
}

// 删除用户勋章
export function delUsermedal(id) {
  return request({
    url: "/system/usermedal/" + id,
    method: "delete",
  });
}

// 获取当前用户的勋章列表
export function getMyMedals() {
  return request({
    url: "/system/usermedal/myMedals",
    method: "get",
  });
}
